<fieldset>
    <legend>条件搜索</legend>
    <form action="{:request()->url()}" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">用户ID</label>
            <label class="layui-input-inline">
                <input class="layui-input" name="id" placeholder="请输入用户ID" value="{:input('id')}">
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">用户手机</label>
            <label class="layui-input-inline">
                <input class="layui-input" name="phone" placeholder="请输入用户手机" value="{:input('phone')}">
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">司机姓名</label>
            <label class="layui-input-inline">
                <input class="layui-input" name="username" placeholder="请输入司机姓名" value="{:input('username')}">
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">注册时间</label>
            <div class="layui-input-inline">
                <input class="layui-input" data-date-range name="create_at" placeholder="请选择注册时间" value="{:input('create_at','')}">
            </div>
        </div>

        <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
<!--            <button class="layui-btn layui-btn-primary" data-form-export="{:url('index')}?id={:input('id')}&phone={:input('phone')}&username={:input('username')}&status={:input('status')}&create_at={:input('create_at')}" type="button">-->
<!--                <i class="layui-icon layui-icon-export"></i> 导 出-->
<!--            </button>-->
        </div>
    </form>

</fieldset>

<script>
    window.form.render();
    require(['excel'], function (excel) {
        excel.bind(function (data) {
            var items = [];
            items.push(['id', '司机姓名', '手机号码', '司机车牌', '预计地点', '预计时间', '车上有无广告', '是否知道需要签1年协议', '司机车牌是否与平台一致']);
                data.forEach(function (item) {
                    items.push([
                        {v: item.id, t: 'n'},
                        item.nickname,
                        item.phone,
                        item.region_province + item.region_city + item.region_area,
                        item.plan_time || '',
                    ]);
                });
            return items;
        }, '会员用户数据');
    });
</script>
